package com.top10.controller;

import com.top10.bean.ResponseBean;
import com.top10.entity.Banner;
import com.top10.service.impl.BannerServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 商家详细信息Controller
 */

@RestController
@RequestMapping("/banner")
public class BannerController {

    @Autowired
    private BannerServiceImpl bannerService;

@RequestMapping(value = "/getbanner",method = RequestMethod.POST)
@ResponseBody
 public ResponseBean getBanner(String shop_uuid)throws Exception{
    if(shop_uuid == null){
        return ResponseBean.createError("输入的参数为空");
    }
    List<Banner> banner= bannerService.getBanner(shop_uuid);
     if(banner == null){
         return ResponseBean.createError("商家信息不存在");
     }else{
         return ResponseBean.createSuccess().setData("banner",banner);
     }

 }
}
